/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package processamento;

import java.awt.image.renderable.ParameterBlock;
import javax.media.jai.InterpolationNearest;
import javax.media.jai.JAI;
import javax.media.jai.PlanarImage;

/**
 *
 * @author Igor
 */
public class OperadorEscala {


    public PlanarImage reescalaImagem(float fator, PlanarImage imagem) {
        ParameterBlock pb = new ParameterBlock();
        pb.addSource(imagem);
        pb.add(fator);
        pb.add(fator);
        pb.add(0.0F);
        pb.add(0.0F);
        pb.add(new InterpolationNearest());
        PlanarImage reescalada = JAI.create("scale", pb);
        return reescalada;
    }
}
